<div class="box box-solid">
    <div class="box-body table-responsive no-padding">
    <?php if(YII_DEBUG): ?>
        <form role="form" action="<?php echo $this->createUrl('system/payadd') ?>" method="post" id="insight">
            <div class="box-body">
                <div class="form-group">
                    <label>支付方式:</label>
                    <input type="text" class="form-control" name="pay_name" id="title"  />
                </div>
            </div>
            <div class="box-footer">
                <button class="btn btn-primary" type="submit">新增支付方式</button>
            </div>
        </form>
    <?php endif; ?>
        <div class="box-body">
                <div class="form-group list">
                    <label>支付方式列表:</label>
                    <table class="table table-hover table-bordered">
                        <tr>
                            <th>编号</th>
                            <th>名称</th>
                            <th>状态</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                            <?php if(!empty($pay_type['data'] )): ?>
                                <?php foreach ($pay_type['data'] as $key => $value) :?>
                                <tr>
                                    <td><?php echo $value['id']; ?></td>
                                    <td><?php echo $value['name']; ?></td>
                                    <td><?php if($value['status'] == Pay::STATUS_NORMAL) echo('<span class="btn btn-sm btn-success">正常</span>') ?><?php if($value['status'] != Pay::STATUS_NORMAL) echo('<span class="btn btn-sm btn-danger ">暂停</span>') ?></td>
                                    <td><?php echo date('Y-m-d H:i:s',$value['ctime']); ?></td>
                                    <td>
                                        <?php if($value['status'] == Pay::STATUS_NORMAL): ?>    
                                            <a onclick="return confirm('确定要暂停该支付方式吗?');" href='<?php echo $this->createUrl("system/paystatus/id/".$value["id"]) ?>'>暂停</a>
                                        <?php else: ?>
                                            <a onclick="return confirm('确定要启用该支付方式吗?');" href='<?php echo $this->createUrl("system/paystatus/id/".$value["id"]) ?>'>启用</a>
                                        <?php endif; ?>
                                        <?php if(YII_DEBUG): ?>
                                        <a onclick="return confirm('确定要删除该支付方式吗?');" href='<?php echo $this->createUrl("system/paydelete/id/".$value["id"]) ?>'>删除</a>
                                        <?php endif; ?>
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </tr>
                    </table>
                </div>
            </div>
    </div>
</div>